package com.log4j.test;

import org.apache.log4j.Logger;

/**  
* @Name: Log4JTest02
* @Description: Log4J测试类
* @Author: 李超
* @Create Date: 2016-12-02
*/
public class Log4JTest02 {
	
	private static Logger logger = Logger.getLogger(Log4JTest02.class) ;
	
	 public static void logTest()  
    {  
        System.out.println("=======Log4JTest02类的日志输出======");  
        logger.info("info级别的日志输出");  
        logger.warn("warn级别的日志输出");  
        logger.error("error级别的日志输出");  
        logger.fatal("fatal级别的日志输出");  
        try  
        {  
            throw new NullPointerException("人工抛出一个异常");  
        }  
        catch (RuntimeException e)  
        {  
        	logger.error(e.getMessage());  
        }  
    }  
	
	public static void main(String[] args) {
		logTest() ;
		System.out.println("==========================================");
		Log4JTest01.testLog4J() ;
	}

}
